<template>
	<view>
		<view class="u-page min-h75">
			<page-nav desc=" "></page-nav>
			<unicloud-db ref="udb" 
			v-slot:default="{data, pagination, loading, hasMore, error}"
				:collection="collectionList" 
				field="name,url,create_time"
				 :page-size="100" getcount 
				 orderby="name"
				 :where="queryWhere">
				<view v-if="error">
					<up-icon name="close" color="#ff0000"></up-icon>error:{{error}}
				</view>
				<view v-else-if="data">
					<uni-list>
						<uni-list-item
						 v-for="(item, index) in data" :key="index"						 
						  showArrow :clickable="true"
							@click="down(item.url)">
							<template #body>
								{{item.name}}
							</template>
						</uni-list-item>
					</uni-list>
				</view>
			</unicloud-db>

			<!--<uni-fab ref="fab" horizontal="right" vertical="bottom" 
		:pop-menu="false" @fabClick="fabClick" />-->
		</view>
		<xasa-foot></xasa-foot>
	</view>
</template>


<script>
	import {
		downword
	} from '@/js_sdk/downword.js';
	export default {
		data() {
			return {
				collectionList: "xasa-template",
				queryWhere: "enable==true"
			};
		},
		methods: {
			down(url) {
				downword(url)
			}
		}
	}
</script>

<style lang="scss">

</style>